package observer;

class HarvesterMachine implements AgriculturalMachineObserver {
    private String machineName;

    public HarvesterMachine(String name) {
        this.machineName = name;
    }

    @Override
    public void update(String environmentInfo) {
        System.out.println("收割机 [" + machineName + "] 收到环境更新：" + environmentInfo);
        // 执行收割机对应的业务逻辑（如调整收割速度、刀片高度等）
        handleBusinessLogic(environmentInfo);
    }

    private void handleBusinessLogic(String info) {
        ////以下写收割机具体的条件对应的行为
        System.out.println("收割机 [" + machineName + "] 根据环境信息调整行为...");
    }
}